<template>
<!-- 内容区轮播图组件 -->
  <article>
    <h4 class="title">-&nbsp;{{contenttitle}}&nbsp;-</h4>
    <div class="swiper">
      <swiper :options="swiperOption" class="page-swiper" ref="mySwiper">
        <!-- slides -->
        <swiper-slide class="swiper-img" v-for="item of contentlist" :key="item.id"><img :src="item.url" alt=""></swiper-slide>
        <!-- Optional controls -->
        <div class="swiper-pagination"  slot="pagination"></div>
      </swiper>
    </div>
  </article>
</template>

<script>
export default {
  name: 'Content',
  data () {
    return {
      swiperOption: {
        autoplay: false,
        pagination: '.swiper-pagination',
        slidesPerView: '2.3'
      }
    }
  },
  props: {
    contenttitle: String,
    contentlist: Array
  }
}
</script>

<style lang="stylus" scoped>
  article
    margin-bottom 20px
    .title
      font-size 32px
      font-weight 700
      height 112px
      display flex
      justify-content center
      align-items center
    .swiper
      margin-bottom 40px
      .swiper-img
        margin-right 24px
        width 250px !important
        img
          width 100%
      .swiper-img:nth-child(1)
        margin-left 32px
</style>
